import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/admin/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/admin/logout',
    method: 'post'
  })
}

export function captch() {
  return request({
    url: '/admin/captch',
    method: 'get',
    responseType: 'arraybuffer'
  })
}

// 注册接口
export function register(data) {
  return request({
    url: '/admin/register',
    method: 'post',
    data: data
  })
}

export function getBaseInfo(){
  return request({
    url: `/admin/getBaseInfo`,
    method: 'get'
  })
}

export function upuserinfo(data) {
  return request({
    url: `/admin/upUserInfo`,
    method: 'put',
    data: data
  })
}

export function resetPassword(data) {
  return request({
    url: `/admin/resetPassword`,
    method: 'post',
    data: data
  })
}
